﻿using System.Web.Mvc;
using System.Web.Routing;

namespace PCE.Mvc.Routing
{
	public class RouteRegistrator
	{
		public void Register(RouteCollection routes)
		{
			routes.IgnoreRoute("elmah.axd");
			
			routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
			
			routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });

			routes.MapRoute(
				"Login",
				"login/{action}",
				new { controller = "Login", action = "LogOn" }
			);

			routes.MapRoute(
				"Registration",
				"register/{action}",
				new { controller = "Register", action = "Create" }
			);

			routes.MapRoute(
				"Profile",
				"profile",
				new { controller = "Profile", action = "Edit" }
			);

			routes.MapRoute(
				"Home", // Route name
				"{controller}/{action}/{id}", // URL with parameters
				new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
			);
		}
	}
}